//
//  main.m
//  FFMPEG-Serial-Demo
//
//  Created by aron on 2017/12/27.
//  Copyright © 2017年 aron. All rights reserved.
//

#import <Foundation/Foundation.h>
#include "yuv-convert.h"
#include "rgb-convertor.h"
#include "simplest_ffmpeg_player.h"
#include "ffmpeg-audio-sdl12.h"
#include "simplest_ffmpeg_audio_player2.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
        
        char* resourceDir = "/Users/aron/git-repo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/resources/";
        
        // Test
//        simplest_yuv420_split("/Users/aron/git-repo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/resources/lena_256x256_yuv420p.yuv", 256, 256, 1);
        
        
//        simplest_rgb_split("/Users/aron/git-repo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/cie1931_500x500.rgb", 500, 500, 1);
        
//        player_main(argc, argv);
//        player("/Users/aron/git-repo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/FFMPEG-Serial-Demo/resources/bigbuckbunny_480x272.h265");
        
        // 音频解码
        char* musicFile = malloc(200);
        sprintf(musicFile, "%sWavinFlag.aac", resourceDir);
//        sprintf(musicFile, "%ssuccess_music.mp3", resourceDir);
        printf("%s", musicFile);
//        decode_audio(musicFile);
        
        audio_player2(musicFile);
    }
    return 0;
}
